import logo from "@/assets/images/logo.png";
import { connect } from "react-redux";
import {
	useAppSelector,
} from '@/utils/hooks'
import avatar from "@/assets/images/avatar.png";

const Logo = (props: any) => {

	const [app] = useAppSelector(state => [state.app])
	const { userInfo } = app

	const { isCollapse } = props;
	return (
		<div className="logo-box">
			<img src={avatar} alt="logo" className="logo-img" />
			{!isCollapse ? <h2 className="logo-text">{userInfo.userName}</h2> : null}
		</div>
	);
};

const mapStateToProps = (state: any) => state.menu;
export default connect(mapStateToProps)(Logo);
